export default {
	/**
	 * toast提示
	 */
	toStr(argDate) {
		const date = argDate || new Date();
		let year = date.getFullYear();
		let month = date.getMonth() + 1;
		let day = date.getDate();
		month = month > 9 ? month : '0' + month;
		day = day > 9 ? day : '0' + day;
		return `${year}-${month}-${day}`;
	},
	add(date,type,val){
		if(type === 'Y'){
			date.setFullYear(date.getFullYear()+val);
		}else if(type === 'M'){
			date.setMonth(date.getMonth()+val);
		}else if(type === 'D'){
			date.setDate(date.getDate()+val);
		}
		return this.toStr(date)
	}
}
